//
//  Utils.h
//  CGNProject
//
//  Created by Michael Shen on 9/21/15.
//  Copyright (c) 2015 Dextrys. All rights reserved.
//

#import <Foundation/Foundation.h>
#include<AssetsLibrary/AssetsLibrary.h>
#import <AVFoundation/AVFoundation.h>
#import "UserInfo.h"

typedef void (^AliPayBlock)(NSDictionary* dic);

@interface Utils : NSObject
+ (NSString *)getUrlWithAction:(NSString *)action parmasAndKeys:(NSString *)first, ... NS_REQUIRES_NIL_TERMINATION;
+ (UIImage *)createImageWithColor: (UIColor *) color;
+(NSString*)getUrlWithAction:(NSString *)action;
+(void)ScreenShot:(UIView*)view;
+ (UIImage *) captureScreen;
+(NSString*)dateToString:(NSDate*)date;
+(NSString*)dataTOjsonString:(id)object;
+(NSString*)changeTheNullString:(NSString*)string;
+(NSNumber*)changeTheNullNumber:(NSNumber*)number;
+(NSString*)dateToThisString:(NSDate*)date;
+ (void)callPhone:(NSString *)phoneNumber;
+(UIColor*)getTheRamdomColor;
+(NSString*)getAppVersion;
+ (UIImage *)imageWithCGImage:(CGImageRef)imageRef scale:(CGFloat)scale orientation:(UIImageOrientation)orientation;
+ (UIImage *)reImage:(UIImage *)image toSize:(CGSize)reSize;
+ (UIImage *)fixOrientation:(UIImage *)aImage ;
+(UIImage*)imageWithNewName:(NSString*)name;
+(UIImage*)imageCompressWithSimple:(UIImage*)image scale:(float)scale;
+(BOOL)isSid;
+(NSString*)intToString:(int)v;
+(NSString*)doubleToString:(double)v;

+(BOOL)isMerchant;
+(NSString*)payStatus:(int)status;
+(NSString*)dateFrom1970s:(long)dateInt;
+(NSString*)covertIntgerToString:(NSInteger)integer;
+(UIFont*)systemDefaultFontOfSize:(CGFloat)size;
//判断是否有获取照片权限
+(BOOL)hasGetPhotoMission;
//判断是否有照相权限
+(BOOL)hasTakePhotoMission;
+(NSString*)dateProductFrom1970s:(long)dateInt;
+(void)playSound:(NSString*)name;
+(CGSize)getTextHeight:(NSString*)strText;
+(NSString*)getCreateNewTime:(NSDate*)date;
+(NSString*)changeTheDateFormat:(NSString*)string;
+(NSString*)yearFrom1970s:(long)dateInt;
//+(UserInfo*)getUserInfo;

+(NSString *)UIImageToBase64Str:(UIImage *) image;
+(UIImage *)Base64StrToUIImage:(NSString *)_encodedImageStr;

+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+ (NSArray *)arrayWithJsonString:(NSString *)jsonString;
+(NSString *)getMMSSFromSS:(NSString *)totalTime;
+(float)getTabBarHeight;
//+(NSDate*)stringChineseToDate:(NSString*)timeString;
+(UserInfo*)getUserInfo;
+(NSString*)formatDate:(NSString*)dateString;
+(NSString *)filterHTML:(NSString *)html;
+(NSString*)getBankName:(NSString*)name;
+(NSString*)getIconName:(NSString*)name;
+(NSString*)dateToStringHHMM:(NSDate *)date;
+(NSDate*)stringToDate:(NSString*)timeString;
+(NSDictionary*)objectToDictionary:(id)object;
+(NSString*)getIconImageName:(NSString*)name;
+(NSArray*)getAllProvince;
+(NSString*)dateChineseToString:(NSDate*)date;
+(NSString*)dateConvert:(NSString*)timeString;
+(NSString*)getTimeFront:(NSString*)time;
+(NSString*)replaceTimeString:(NSString*)timeString;
+(float)getFloatFromString:(NSString*)string;
+ (NSObject *)removeNullFrom:(NSObject *)object;
+(BOOL)getUserPermission:(NSString*)action;

@end
